package com.ddwl.order.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.common.feign.api.GoodsApi;
import com.ddwl.order.service.OrderInfoServer;
import com.ddwl.schema.vo.base.RestVo;
import com.ddwl.schema.vo.goods.ItemDetailVo;
import com.ddwl.schema.vo.order.OrderInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 类OrderApiController.java的实现描述：订单api接口
 *
 * @author 27670
 * @Date :2020-07-22 13:41.
 */
@Api
@RestController
@RequestMapping("api")
public class OrderApiController extends BaseController {

    @Resource
    private OrderInfoServer orderInfoServer;

    @Resource
    private GoodsApi goodsApi;

    @GetMapping("/{orderId}")
    @ApiOperation("获取订单详情")
    @Auth(product = {BaseEnum.ProductEnum.API})
    public RestVo<OrderInfoVo> getOrderInfoVo(@PathVariable String orderId) {
        return RestVo.ok(orderInfoServer.getOrderInfoVo(orderId));
    }

}
